<template>
    <div>
        <p class="desch4">{{goodsDesc.title}}</p>
        <div v-html="goodsDesc.content" class="content"></div>
    </div>
</template>
<script>
export default {
    data () {
        return {
            goodsDesc:{}
        };
    },
    created(){
        this.getGoodsDesc()
    },
    methods:{
        //获取商品的图文介绍
        async getGoodsDesc(){
            console.log("111");
            const goodsId = this.$route.params.id;
            const res = await this.$axios.get(`/api/goods/getdesc/${goodsId}`)
            console.log(res);
            
            this.goodsDesc = res.data.message[0]
            console.log(this.goodsDesc);
        }
    }
}
</script>
<style scoped lang="less">
.desch4{
    color: #226aff;
    padding: 20px 0;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid #ccc;
}
.content{
    width: 100%;
    overflow: hidden;
    padding: 0 5px;
}
</style>